﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace DailyApp.WPF.Helpers
{
    /// <summary>
    /// MD5工具类，实现对密码进行MD5加密
    /// </summary>
    internal class Md5Helper
    {
        /// <summary>
        /// Md5加密   
        /// </summary>
        /// <param name="content">明文密码</param>
        /// <returns>MD5加密后的密码</returns>
        public static string GetMd5(string content)
        {
            return string.Join("", MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(content)).Select(x => x.ToString("x2")));
        }
    }
}
